/ An individual post
.post
  .header
    - if @user
      .controls
        = link_to(image_tag("icons/trash.gif", :alt => "delete"), { :action => "destroy", :id => post.id }, :confirm => "Are you sure?", :method => :delete)
        = link_to(image_tag("icons/edit.gif", :alt => "edit"), { :controller => "admins", :action => "edit_post", :id => post.id})
        = link_to(image_tag("icons/lock.gif", :alt => "lock"), { :action => "lock", :id => post.id }, :confirm => "Are you sure?", :method => :lock)
    %h1 
      = link_to post.title, post
    %br{:style => "clear: both;"}
    %h2
      = "posted #{cachable_time_ago_in_words(post.published_at)} ago by #{link_to(post.user.name) if post.user}"
  %br{:style => "clear:both;"}
  .body
    = image_tag(post.asset.public_filename) if post.asset
    ~ post.body
    %br{:style => "clear: both"}
  .footer
    .left
      - if post.tag_list.size > 0
        - for tag in post.tag_list
          = link_to tag, { :controller => :searches, :action => :tag, :tag => tag }
      = render :partial => "post_sharethis" if APP_SETTINGS[:show_sharethis]
    .right
      - if params[:action] == "index"
        - if APP_SETTINGS[:comment_system] == "internal"
          - if post.comments.count > 0
            = link_to "#{image_tag("icons/quote.gif", :alt => "comment")} #{post.comments.count} comments ", post, :name => "comments"
          - else 
            = link_to "#{image_tag("icons/quote.gif", :alt => "comment")} comment", :action => :show, :id => post.id
        - elsif APP_SETTINGS[:comment_system] == "disqus"
          = link_to "#{image_tag("icons/quote.gif", :alt => "comment")} comments", post, :name => "disqus_thread"
        - elsif APP_SETTINGS[:comment_system] == "intense_debate"
          = link_to "#{image_tag("icons/quote.gif", :alt => "comment")} comments", :action => :show, :id => post.id
    %br{:style => "clear: both"}
